package cn.touna.jss.modules.third.dianhuabang.utils;

import java.util.Date;

public class TimestampUtil {

    public static Long getOffsetTimestamp(Long timestamp, int offset) {
        if (timestamp == null) {
            return null;
        }
        String str = timestamp.toString();
        if (str.length() > offset) {
            str = str.substring(0, offset);
            return Long.parseLong(str);
        }
        return timestamp;
    }


    public static void main(String[] args) {
        System.out.println(getOffsetTimestamp(new Date().getTime(),10));
    }
}
